<template>
  <div class="NumbeRFMaintenMZZJJZ">
    <div class="pubBig standard ">
      <div class="h0">
        <p class="lt">财务主题报表</p>
      </div>

      <el-row
        class="selectTime"
        style="padding: 6px"
      >

        <el-col :span="4">
          <span>机构：</span>
          <el-tooltip
            :disabled="disabledTooltip"
            style="width: 180px!important;"
            effect="dark"
            :content="selectZZJGNames"
            placement="top"
          >

            <el-select
              v-model="selectZZJGNames"
              placeholder="请选择机构"
              style="width: 180px;text-overflow: ellipsis;"
              show-overflow-tooltip
              ref="selectReport"
            >
              <el-option
                style="width: 380px;height:200px;overflow: auto;background-color:#fff"
              >
                <el-tree
                  :data="ZZJGList"
                  :check-strictly="true"
                  :props="defaultProps"
                  node-key="id"
                  @node-click="handleNodeClick"
                ></el-tree>
                <el-tree
                  v-if="false"
                  :data="ZZJGList"
                  show-checkbox
                  node-key="id"
                  ref="treeJG"
                  :props="defaultProps"
                  @check="handleCheck"
                  default-expand-all
                  :check-strictly="true"
                  :expand-on-click-node="false"
                >
                  <span
                    class="custom-tree-node"
                    slot-scope="{ node, data }"
                  >
                    <span v-if="false">{{ node.label }}</span>
                    <el-dropdown @command="handleCommand">
                      <span class="el-dropdown-link">
                        {{ node.label }}<i
                          class="el-icon-arrow-down el-icon--right"
                        ></i>
                      </span>
                      <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item
                          :command="beforeHandleCommand(0, data,'本机构')"
                        >本机构</el-dropdown-item>
                        <el-dropdown-item
                          :command="beforeHandleCommand(0, data,'本机构及下属机构')"
                        >本机构及下属机构</el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                  </span>
                </el-tree>
              </el-option>
            </el-select>
          </el-tooltip>
        </el-col>
        <el-col :span="2">
          <Button
            type="primary"
            icon="ios-search"
            @click="setSelectQK"
          >清空</Button>
        </el-col>
        <el-col :span="4">
          <el-date-picker
            type="date"
            placeholder="Select date"
            @change="getDataList()"
            style="width: 200px"
            v-model="queryDataObj.BeginDate"
            value-format="yyyy-MM-dd"
          ></el-date-picker>
        </el-col>
        <el-col
          :span="1"
          style="color: #348EED;font-size: 16px;text-align:center;padding: 6px"
        >至</el-col>
        <el-col :span="4">
          <el-date-picker
            type="date"
            placeholder="Select date"
            @change="getDataList()"
            style="width: 200px"
            v-model="queryDataObj.EndDate"
            value-format="yyyy-MM-dd"
          ></el-date-picker>
        </el-col>
        <el-col :span="2">
          <Button
            type="primary"
            @click="getDataList()"
            icon="ios-search"
          >搜索</Button>
        </el-col>
        <el-col :span="2">
          <Button
            type="primary"
            @click="output()"
            icon="ios-search"
          >导出</Button>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div id="container8">

            <el-table
              :data="tableDataList"
              style="width: 100%;margin-bottom: 20px;"
              row-key="id"
              id="Excel1"
              border
              show-summary
              :summary-method="getSummaries"
              :tree-props="{children: 'childs', hasChildren: 'hasChildren'}"
            >
              <el-table-column
                prop="name"
                label="机构名称"
                sortable
                width="210"
              >
              </el-table-column>
              <el-table-column
                prop="MZ"
                label="门诊收入"
                sortable
                width="180"
              >
              </el-table-column>
              <el-table-column
                prop="ZY"
                label="住院收入"
              >
              </el-table-column>
              <el-table-column
                prop="Cost"
                label="收入合计"
              >
              </el-table-column>
            </el-table>

          </div>
        </el-col>
      </el-row>

    </div>
  </div>
</template>
<script>
import echarts from 'echarts'
import FileSaver from "file-saver"
import XLSX from "xlsx"
export default {
  name: "Bedinformation",
  data () {
    return {//定义全局变量
      barData: {
        Mon: 13253,
        Tue: 34235,
        Wed: 26321,
        Thu: 12340,
        Fri: 24643,
        Sat: 1322,
        Sun: 1324
      },
      selectZZJG: {
        name: ""
      },
      selectZZJGNames: "",
      selectZZJGIDList: [],
      ZZJGList: [],
      defaultProps: {
        children: 'childs',
        label: 'name'
      },
      disabledTooltip: true,
      queryDataObj: {
        BeginDate: "",
        EndDate: "",
        Hospitals: []
      },

      /****************收入结构*********************/
      srjgKeys: [],
      srjgValues: [],
      /****************病人费用统计*********************/
      BRFYtimeList: [],//时间轴
      BRFYmzDate: [],//门诊费用数据
      BRFYzyDate: [],//住院费用数据
      /****************月收入统计*********************/
      YSRtimeList: [],//时间轴
      YSRypDate: [],//药品费用数据
      YSRzlDate: [],//诊疗费用数据
      /******************机构财务树结构************************/
      tableData: [],
      tableData22: [],
      tableDataList: [],
    }
  },
  methods: {

    output () {
      var wb = XLSX.utils.table_to_book(document.querySelector("#Excel1"));//mytable为表格的id名
      /* get binary string as output */
      var wbout = XLSX.write(wb, {
        bookType: "xlsx",
        bookSST: true,
        type: "array"
      });
      try {
        FileSaver.saveAs(
          new Blob([wbout], { type: "application/octet-stream" }),
          "财务概况.xlsx"//导出的表名
        );
      } catch (e) {
        if (typeof console !== "undefined") console.log(e, wbout);
      }
      return wbout;
    },
    showTooltip () {
      console.log("数据111111111122222")
      const lifeW = this.selectZZJGNames;
      console.log(lifeW)
      console.log(lifeW.length)
      this.disabledTooltip = lifeW.length < 20
      console.log(this.disabledTooltip)
    },
    beforeHandleCommand (index, row, command) {
      return {
        'index': index,
        'row': row,
        'command': command
      }
    },
    handleCommand (command) {
      switch (command.command) {
        case "本机构"://本机构
          console.log("本机构@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
          console.log(command.row)
          this.selectBJG(command.row)
          break;
        case "本机构及下属机构"://本机构及下属机构
          this.selectAllJG(command.row)
          break;

      }
    },
    setSelectQK () {
      this.selectZZJGNames = "";
      this.selectZZJGIDList = []
      this.$refs.treeJG.setCheckedKeys([]);
    },
    selectBJG (data) {
      console.log("选中本机构")
      console.log(data)
      this.selectZZJGNames = "";
      this.selectZZJGIDList = []
      var isCZ = false
      this.selectZZJGIDList.forEach(m => {
        if (m.id == data.id) {
          isCZ = true
        }
      })
      if (isCZ == false) {
        var obj = {
          id: data.id,
          name: data.name
        }
        this.selectZZJGIDList.push(obj)
        var keys = [];
        this.selectZZJGNames = ""
        this.selectZZJGIDList.forEach(m => {
          keys.push(m.id)
          this.selectZZJGNames += m.name + ","
        })
        console.log("选中机构打勾")
        this.$refs.treeJG.setCheckedKeys(keys);
      }
    },
    selectAllJG (data) {
      console.log("选中本机构")
      console.log(data)
      this.selectZZJGNames = "";
      this.selectZZJGIDList = []
      var isCZ = false
      this.selectZZJGIDList.forEach(m => {
        if (m.id == data.id) {
          isCZ = true
        }
      })
      if (isCZ == false) {
        var obj = {
          id: data.id,
          name: data.name
        }
        this.selectZZJGIDList.push(obj)
      }
      data.childs.forEach(m => {
        var isCZ2 = false
        this.selectZZJGIDList.forEach(n => {
          if (m.id == n.id) {
            isCZ2 = true
          }
        })
        if (isCZ2 == false) {
          var obj = {
            id: m.id,
            name: m.name
          }
          this.selectZZJGIDList.push(obj)
        }

        if (m.childs.length > 0) {
          m.childs.forEach(m1 => {
            var isCZ21 = false
            this.selectZZJGIDList.forEach(n => {
              if (m1.id == n.id) {
                isCZ21 = true
              }
            })
            if (isCZ21 == false) {
              var obj = {
                id: m1.id,
                name: m1.name
              }
              this.selectZZJGIDList.push(obj)
            }

            if (m1.childs.length > 0) {
              if (m1.childs.length > 0) {
                m1.childs.forEach(m11 => {
                  var isCZ211 = false
                  this.selectZZJGIDList.forEach(n => {
                    if (m11.id == n.id) {
                      isCZ211 = true
                    }
                  })
                  if (isCZ211 == false) {
                    var obj = {
                      id: m11.id,
                      name: m11.name
                    }
                    this.selectZZJGIDList.push(obj)
                  }

                  if (m11.childs.length > 0) {

                  }
                })
              }
            }
          })
        }
      })


      var keys = [];
      this.selectZZJGNames = ""
      this.selectZZJGIDList.forEach(m => {
        keys.push(m.id)
        this.selectZZJGNames += m.name + ","
      })
      console.log("选中机构打勾")
      this.$refs.treeJG.setCheckedKeys(keys);


    },
    handleNodeClick (data) {
      console.log("选中机构及￥￥￥￥￥￥￥￥￥￥￥￥￥￥￥￥");
      console.log(data);
      this.$refs.selectReport.blur()
      // this.selectZZJG=data;
      this.selectZZJGNames = data.name
      this.selectZZJGIDList = []
      var obj = {
        id: data.id
      }
      this.selectZZJGIDList.push(obj)

      this.tableData = [];
      this.tableData.push(data)
      console.log("打印this.tableData");
      console.log(this.tableData);
    },
    handleCheck (checkedNodes, checkedKeys) {
      console.log("选中机构节点1")
      console.log(checkedNodes)
      console.log("选中机构节点2")
      console.log(checkedKeys)
      console.log(checkedKeys.checkedNodes)

      this.selectZZJGNames = "";
      this.selectZZJGIDList = []
      checkedKeys.checkedNodes.forEach(m => {
        var obj = {
          id: m.id,
          name: m.name
        }
        this.selectZZJGIDList.push(obj)
        this.selectZZJGNames += m.name + ","
      })


    },
    handleCheckChange (data, checked, indeterminate) {
      // console.log("选中机构节点1")
      //  console.log(data)
      //  console.log("选中机构节点2")
      //  console.log(checked)
      //  console.log("选中机构节点3")
      //  console.log(indeterminate)
    },


    //    GET /api/BaseDict/GetList
    getDataList () {
      var list = this.tableDataList;
      this.tableDataList = [];
      var that = this;
      console.log("赋值机构list1")
      console.log(list)
      setTimeout(() => {
        that.tableDataList = list
        console.log("赋值后机构list2")
        console.log(that.tableDataList)
        that.showTooltip();
        that.getDataList2()
      }, 1500);
    },
    getDataList2 () {
      console.log("打印this.tableData#############################");
      console.log(this.tableData);
      if (this.tableData == null || this.tableData.length == 0) {
        this.$message({ showClose: true, message: "请选择机构后查询", type: "error" });
        return
      }
      this.queryDataObj.Hospitals = [];
      this.tableData.forEach(m => {
        this.queryDataObj.Hospitals.push(m.id);
        if (m.childs != null && m.childs.length > 0) {
          m.childs.forEach(m1 => {
            this.queryDataObj.Hospitals.push(m1.id);
            if (m1.childs != null && m1.childs.length > 0) {
              m1.childs.forEach(m2 => {
                this.queryDataObj.Hospitals.push(m2.id);
                if (m2.childs != null && m2.childs.length > 0) {
                  m2.childs.forEach(m3 => {
                    this.queryDataObj.Hospitals.push(m3.id);
                    if (m3.childs != null && m3.childs.length > 0) {
                      m3.childs.forEach(m4 => {
                        this.queryDataObj.Hospitals.push(m4.id);
                        if (m4.childs != null && m4.childs.length > 0) {
                          m4.childs.forEach(m5 => {
                            this.queryDataObj.Hospitals.push(m5.id);
                          })
                        }
                      })
                    }
                  })
                }
              })
            }
          })
        }

      })

      var params = this.queryDataObj;
      console.log("请求查询传参");
      console.log(params);
      this.$post("/BI/getCWZT1List", params)
        .then(res => {
          console.log("请求查询返回值");
          console.log(res.data);
          if (res.code == 0) {
            this.tableData22 = res.data.FinalList;
            this.tableData22.forEach(m => {
              if (!isNaN(m.Cost) && m.Cost !== '') {
                // 截取当前数据到小数点后两位
                m.Cost = parseFloat(m.Cost).toFixed(2)
              } else {
                // m.Cost = '0'
              }
            })


            var Data = this.tableData
            Data.forEach(m => {
              this.tableData22.forEach(n => {
                if (m.id == n.HospitalId) {
                  m.MZ = n.MZ
                  m.ZY = n.ZY
                  m.Cost = n.Cost
                }
              })
              if (m.childs != null && m.childs.length > 0) {
                m.childs.forEach(m1 => {
                  this.tableData22.forEach(n => {
                    if (m1.id == n.HospitalId) {
                      m1.MZ = n.MZ
                      m1.ZY = n.ZY
                      m1.Cost = n.Cost
                    }
                  })
                  if (m1.childs != null && m1.childs.length > 0) {
                    m1.childs.forEach(m2 => {
                      this.tableData22.forEach(n => {
                        if (m2.id == n.HospitalId) {
                          m2.MZ = n.MZ
                          m2.ZY = n.ZY
                          m2.Cost = n.Cost
                        }
                      })
                      if (m2.childs != null && m2.childs.length > 0) {
                        m2.childs.forEach(m3 => {
                          this.tableData22.forEach(n => {
                            if (m3.id == n.HospitalId) {
                              m3.MZ = n.MZ
                              m3.ZY = n.ZY
                              m3.Cost = n.Cost
                            }
                          })
                          if (m3.childs != null && m3.childs.length > 0) {
                            m3.childs.forEach(m4 => {
                              this.tableData22.forEach(n => {
                                if (m4.id == n.HospitalId) {
                                  m4.MZ = n.MZ
                                  m4.ZY = n.ZY
                                  m4.Cost = n.Cost
                                }
                              })
                              if (m4.childs != null && m4.childs.length > 0) {

                              }
                            })
                          }
                        })
                      }
                    })
                  }
                })
              }
            })
            this.tableDataList = [];
            this.tableDataList = Data

            console.log("赋值后")
            console.log(this.tableDataList)

          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
          this.$message({ showClose: true, message: err, type: "error" });
        });


    },


    getSummaries (param) {
      console.log("计算合计")
      console.log(param)
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计';
          return;
        }
        var values1 = 0;
        data.map(item => {
          console.log("计算合计数据1@@@@@@@@@@@@@##########################")
          console.log(item)
          console.log("计算合计数据2@@@@@@@@@@@@@##########################")
          console.log(column.property)
          console.log("计算合计数据32@@@@@@@@@@@@@##########")
          console.log(item[column.property])
          if (item[column.property] != null && item[column.property] != "undefined" && item[column.property].valueOf() != null && item[column.property].valueOf() != 'undefined') {
            values1 += parseFloat(item[column.property].valueOf())
          }
          if (item.childs != null && item.childs.length > 0) {
            item.childs.forEach(m => {
              if (m[column.property] != null && m[column.property] != "undefined" && m[column.property].valueOf() != null && m[column.property].valueOf() != 'undefined') {
                values1 += parseFloat(m[column.property].valueOf())
              }
              if (m.childs != null && m.childs.length > 0) {
                m.childs.forEach(m1 => {
                  if (m1[column.property] != null && m1[column.property] != "undefined" && m1[column.property].valueOf() != null && m1[column.property].valueOf() != 'undefined') {
                    values1 += parseFloat(m1[column.property].valueOf())
                  }
                  if (m1.childs != null && m1.childs.length > 0) {
                    m1.childs.forEach(m2 => {
                      if (m2[column.property] != null && m2[column.property] != "undefined" && m2[column.property].valueOf() != null && m2[column.property].valueOf() != 'undefined') {
                        values1 += parseFloat(m2[column.property].valueOf())
                      }
                      if (m2.childs != null && m2.childs.length > 0) {
                        m2.childs.forEach(m3 => {
                          if (m3[column.property] != null && m3[column.property] != "undefined" && m3[column.property].valueOf() != null && m3[column.property].valueOf() != 'undefined') {
                            values1 += parseFloat(m3[column.property].valueOf())
                          }
                          if (m3.childs != null && m3.childs.length > 0) {
                            m3.childs.forEach(m4 => {
                              if (m4[column.property] != null && m4[column.property] != "undefined" && m4[column.property].valueOf() != null && m4[column.property].valueOf() != 'undefined') {
                                values1 += parseFloat(m4[column.property].valueOf())
                              }
                              if (m4.childs != null && m4.childs.length > 0) {
                                m4.childs.forEach(m5 => {
                                  if (m5[column.property] != null && m5[column.property] != "undefined" && m5[column.property].valueOf() != null && m5[column.property].valueOf() != 'undefined') {
                                    values1 += parseFloat(m5[column.property].valueOf())
                                  }
                                })
                              }
                            })
                          }
                        })
                      }
                    })
                  }
                })
              }
            })
          }
        })
        console.log("计算合计数据4@@@@@@@@@@@@@##########################")
        console.log(values1)

        var value = [];
        value.push(values1)
        const values = value
        // const values = data.map(item => Number(item[column.property]));
        console.log("计算合计数据")
        console.log(values)
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            console.log("计算合计数据5@@@@@@@@@@@@@##########################")
            console.log(value)
            if (!isNaN(value)) {
              console.log("计算合计数据61@@@@@@@@@@@@@##########################")
              console.log(prev)
              console.log("计算合计数据62@@@@@@@@@@@@@##########################")
              console.log(curr)
              return parseFloat(curr).toFixed(2).valueOf();
            } else {
              console.log("计算合计数据63@@@@@@@@@@@@@##########################")
              console.log(prev)
              return prev;
            }
          }, 0);
          sums[index] += ' ';
        } else {
          sums[index] = 'N/A';
        }
      });

      return sums;
    },
    //
    init () {
      // this.getData();
      //
      var dom = document.getElementById("container");
      var myChart = echarts.init(dom);


      var dom4 = document.getElementById("container4");
      var myChart4 = echarts.init(dom4);


      //********************************************************************


      var dom7 = document.getElementById("container7");
      var myChart7 = echarts.init(dom7);


      //收入结构
      var optionQYYS = {
        title: {
          text: '收入结构(万元)',
          subtext: '',
          x: 'center'
        },
        tooltip: {
          trigger: 'item',
          formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
          orient: 'vertical',
          left: 'left',
          data: this.srjgKeys
        },
        series: [
          {
            name: '',
            type: 'pie',
            radius: '50%',
            center: ['50%', '50%'],
            data: this.srjgValues,
            itemStyle: {
              emphasis: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                normal: {
                  //颜色设置
                  color: function (params) {
                    let colorList = [
                      "#4BABDE",
                      "#FFDE76",
                      "#E43C59",
                      "#61a0a8",
                      "#d48265",
                      "#91c7ae",
                      "#749f83",
                      "#c23531",
                      "#2f4554",
                      "#ca8622",
                      "#bda29a",
                      "#6e7074",
                      "#546570",
                      "#c4ccd3",

                      "#37A2DA"
                    ];
                    return colorList[params.dataIndex];
                  }
                }
              }
            }
          }
        ]
      };
      myChart.setOption(optionQYYS, true);//收入结构


      //*********************第二行****************************
      //全院预算执行进度
      var optionHZFD = {
        title: {
          text: '病人费用统计',
          subtext: ''
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['次均门诊费用（元）', '次均住院费用（百元）']
        },
        calculable: true,
        xAxis: [
          {
            type: 'category',
            boundaryGap: false,
            data: this.BRFYtimeList
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: {
              formatter: '{value} '
            }
          }
        ],
        series: [
          {
            name: '次均门诊费用（元）',
            type: 'line',
            data: this.BRFYmzDate,
            markLine: {
              data: [
                { type: 'average', name: '平均值' }
              ]
            }
          },
          {
            name: '次均住院费用（百元）',
            type: 'line',
            data: this.BRFYzyDate,

            markLine: {
              data: [
                { type: 'average', name: '平均值' }
              ]
            }
          }
        ]
      };
      myChart7.setOption(optionHZFD, true);

      //业务收入
      var optionYWSR = {
        title: {
          text: '月收入统计',
          subtext: ''
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['业务收入（万元）', '药品收入（万元）']
        },
        calculable: true,
        xAxis: [
          {
            type: 'category',
            data: this.YSRtimeList
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: [
          {
            name: '业务收入',
            type: 'bar',
            data: this.YSRzlDate,
            markPoint: {
              data: [
                { type: 'max', name: '最大值' },
                { type: 'min', name: '最小值' }
              ]
            },
            markLine: {
              data: [
                { type: 'average', name: '平均值' }
              ]
            }
          },
          {
            name: '药品收入',
            type: 'bar',
            data: this.YSRypDate,
            markPoint: {
              data: [
                // {name: '最大值', value: 182.2, xAxis: 7, yAxis: 183, symbolSize: 18},
                // {name: '最小值', value: 2.3, xAxis: 11, yAxis: 3}
                { type: 'max', name: '最大值' },
                { type: 'min', name: '最小值' }
              ]
            },
            markLine: {
              data: [
                { type: 'average', name: '平均值' }
              ]
            }
          }
        ]
      };
      myChart4.setOption(optionYWSR, true);

    },//界面加载完成后执行
    formatDateTime (date, dt) {
      var nd = date
      nd = nd.valueOf()
      nd = nd + dt * 24 * 60 * 60 * 1000
      nd = new Date(nd)
      var y = nd.getFullYear()// 获取年
      var m = nd.getMonth() + 1// 获取月
      var d = nd.getDate()// 获取天
      var h = nd.getHours()// 获取小时
      var f = nd.getMinutes()// 获取分钟
      var s = nd.getSeconds()// 获取秒
      if (m <= 9) m = '0' + m
      if (d <= 9) d = '0' + d
      if (h <= 9) h = '0' + h
      if (f <= 9) f = '0' + f
      if (s <= 9) s = '0' + s
      // var cdate = y + '-'  + m +  '-'  + d + ' '  + h +  ':'  + f +  ':'  + s;
      var cdate = y + '-' + m + '-' + d
      return cdate

    },
  },
  mounted () {
    this.init();
  },
  watch: {
    selectZZJGNames: {
      handler (newVal, objVal) {
        console.log("触发改变%%%%%%%%%%%%%%%%%%%55")
        this.showTooltip()
        this.getDataList()
      },
    }
  },
  created () {
    this.msg = this.$route.query;
    console.log("接收过来的传参#############################################################################")
    console.log(this.msg)
    if (this.msg.Token != null && this.msg.Token != "") {
      console.log("设置Token")
      this.$setToken(this.msg.Token)
      this.$setItemUrl(this.msg.ItemIP)
      var loginInfor = this.msg.loginInfor;
      this.LoginInfor = JSON.parse(loginInfor);
      console.log("个人登录信息");
      console.log(this.LoginInfor);

    } else {
      console.log("Token为空")
      var loginInfor = localStorage.getItem('LoginInfor');
      this.LoginInfor = JSON.parse(loginInfor);
      console.log("个人登录信息");
      console.log(this.LoginInfor);
      if (this.LoginInfor == null) {
        this.LoginInfor = {
          SectionName: "",
          UserName: ""
        }
      }
    }
    console.log("获取机构代码………………………………………………………………………………")
    this.ZZJGList = []
    this.ZZJGList.push(this.LoginInfor.HospitalTree)
    console.log(this.ZZJGList);

    if (this.ZZJGList.length > 0) {
      this.selectZZJGNames = this.LoginInfor.HospitalName + ","
      var obj = {
        id: this.LoginInfor.HospitalId,
        name: this.LoginInfor.HospitalName
      }
      this.selectZZJGIDList.push(obj)
      // this.$refs.treeJG.setCheckedKeys([obj.id]);
    }
    this.tableData = this.ZZJGList


    this.queryDataObj.BeginDate = this.formatDateTime(new Date(), -90); //挂号日期
    this.queryDataObj.EndDate = this.formatDateTime(new Date(), 0); //挂号日期
  }
};
</script>
<style lang="scss">
.NumbeRFMaintenMZZJJZ {
  .el-table td,
  .el-table th {
    padding: 8px 0 !important;
  }

  .selectTime {
    .el-input__icon {
      height: 100%;
      width: 25px;
      display: none;
      text-align: center;
      -webkit-transition: all 0.3s;
      transition: all 0.3s;
      line-height: 40px;
    }

    .input {
      width: 90px !important;
      height: 28px !important;
    }
  }

  .ypList {
    .el-input__inner {
      height: 20px !important;
      padding: 0 0 0 15px !important;
    }

    .el-input__inner {
      -webkit-appearance: none;
      background-color: #fff;
      background-image: none;
      border-radius: 4px;
      border: 1px solid #dcdfe6;
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
      color: #606266;
      display: inline-block;
      font-size: 10px !important;
      height: 40px;
      line-height: 40px;

      -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
      transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
      width: 100%;
    }

    .el-autocomplete-suggestion li {
      padding: 0px 6px !important;
      margin: 0;
      line-height: 34px;
      cursor: pointer;
      color: #606266;
      font-size: 10px !important;
      list-style: none;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .selectPic {
    ul {
      padding: 0;
      display: none;
    }
  }

  .camera_outer {
    position: relative;
    overflow: hidden;
    background: #0a1015;
    background-size: 100%;

    video,
    canvas,
    .tx_img {
      -moz-transform: scaleX(-1);
      -webkit-transform: scaleX(-1);
      -o-transform: scaleX(-1);
      transform: scaleX(-1);
    }

    .btn_camera {
      position: absolute;
      bottom: 4px;
      left: 0;
      right: 0;
      height: 50px;
      background-color: rgba(0, 0, 0, 0.3);
      line-height: 50px;
      text-align: center;
      color: #ffffff;
    }

    .bg_r_img {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      top: 0;
    }

    .img_bg_camera {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      top: 0;

      img {
        width: 100%;
        height: 100%;
      }

      .img_btn_camera {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50px;
        line-height: 50px;
        text-align: center;
        background-color: rgba(0, 0, 0, 0.3);
        color: #ffffff;

        .loding_img {
          width: 50px;
          height: 50px;
        }
      }
    }
  }

  .Dilog {
    .column2 {
      width: 128rem;
      margin: 50px auto;
      background: #fff;
      border-radius: 5px;
      position: relative;
    }

    .form-control {
      width: 96px !important;
    }
  }

  .DilogYP {
    .column2 {
      width: 680px;
      margin: 50px auto;
      background: #fff;
      border-radius: 5px;
      position: relative;
    }

    .form-control {
      width: 96px !important;
    }
  }

  .div_P {
    .form-control {
      display: inline-block;
      width: 12rem;
      height: 32px;
      padding: 5px 12px;
      font-size: 14px;
      line-height: 1.42857143;
      color: #555;
      background-color: #fff;
      background-image: none;
      border: 1px solid #ccc;
      border-radius: 4px;
      -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
      box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
      -webkit-transition: border-color ease-in-out 0.15s,
        -webkit-box-shadow ease-in-out 0.15s;
      transition: border-color ease-in-out 0.15s,
        -webkit-box-shadow ease-in-out 0.15s;
      transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
      transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s,
        -webkit-box-shadow ease-in-out 0.15s;
    }

    .form-group {
      height: 45px;
      margin: 0;
      line-height: 32px;
      padding: 6px 15px 0 15px;
    }
  }

  .elRadioYygh {
    .column2 label {
      width: 52px !important;
    }

    .el-radio-button__inner {
      padding: 6px 11px;
    }
  }

  .fjtable {
    .el-table {
      font-size: 10px !important;
    }
  }

  .cardP {
    .text {
      font-size: 14px;
    }

    .el-card__header {
      padding: 18px 20px;
      border-bottom: 1px solid #ebeef5;
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
      background-color: azure;
    }

    .item {
      margin-bottom: 18px;
    }

    .clearfix:before,
    .clearfix:after {
      display: table;
      content: "";
    }

    .clearfix:after {
      clear: both;
    }

    .box-card {
      width: 100%;
    }
  }

  .cardPdd {
    .text {
      font-size: 14px;
    }

    .el-card__header {
      padding: 18px 20px;
      border-bottom: 1px solid #ebeef5;
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
      background-color: azure;
    }

    .item {
      margin-bottom: 18px;
    }

    .clearfix:before,
    .clearfix:after {
      display: table;
      content: "";
    }

    .clearfix:after {
      clear: both;
    }

    .box-card {
      width: 100%;
    }

    .el-card__body {
      padding: 2px;
    }
  }

  .cardPD {
    .text {
      font-size: 12px;
    }

    .el-card__header {
      padding: 8px 20px;
      border-bottom: 1px solid #ebeef5;
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
      background-color: azure;
    }

    .item {
      margin-bottom: 18px;
    }

    .clearfix:before,
    .clearfix:after {
      display: table;
      content: "";
    }

    .clearfix:after {
      clear: both;
    }

    .box-card {
      width: 100%;
    }
  }

  .cardC {
    .text {
      font-size: 14px;
    }

    .el-card__header {
      padding: 10px 20px;
      border-bottom: 1px solid #ebeef5;
      -webkit-box-sizing: border-box;
      box-sizing: border-box;
      background-color: white;
    }

    .el-card__body {
      padding: 8px;
    }

    .item {
      margin-bottom: 18px;
    }

    .clearfix:before,
    .clearfix:after {
      display: table;
      content: "";
    }

    .clearfix:after {
      clear: both;
    }

    .box-card {
      width: 100%;
    }
  }

  .el-tree-node.is-current > .el-tree-node__content {
    color: #fff;
    background: #155a00 !important;
  }

  .dRightMain {
    padding: 18px;
  }

  .custom-tree-node {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    padding-right: 8px;
  }

  .el-table {
    font-size: 14px !important;
  }

  .el-table thead {
    color: #303133;
  }

  .dRightMain .Tb {
    position: absolute;
    top: 91px;
    left: 240px;
    right: 15px;
    bottom: 0;
    border: 1px solid #ddd;
  }
}
</style>
